/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.ufba.lasid.v1.jitclouds.mda.examples;

import br.ufba.lasid.v1.jitclouds.mda.MDA;
import br.ufba.lasid.v1.jitclouds.mda.datatypes.virtualization.IVirtualMachine;
import br.ufba.lasid.v1.jitclouds.mda.datatypes.virtualization.KVM;
import br.ufba.lasid.v1.jitclouds.mda.datatypes.virtualization.KVMVirtualMachine;
import br.ufba.lasid.v1.jitclouds.mda.providers.KVMProvider;

/**
 *
 * @author aliriosa
 */
public class KVMSample{
   public static void main(String[] args) throws Exception{
        MDA.startup();
        MDA.BaseOptions.setProperty(MDA.HypervisorTag, "kvm");
        KVM kvm = (KVM) MDA.createHypervisor();
        
        for(IVirtualMachine machine : kvm.getMachines()){
            kvm.startup((KVMVirtualMachine)machine);
        }
        
        for(IVirtualMachine machine : kvm.getMachines()){
            kvm.shutdown((KVMVirtualMachine)machine);
        }
        
                
    }

}
